﻿namespace Sai.Test.Sandcastle
{
	using System.IO;
	using Sai.Core;
	using Sai.Core.Sandcastle;
	using Sai.Test.TestDataBuilders;
	using Xunit;
    using Sai.Test.XUnit;

	public class TopicIdReaderFacts
	{
		public class TheLoadFromMethod
		{
			
			[Fact, InMemoryTest]
			public void Finds_Topic_Identifier_On_Same_Line_As_TopicId()
			{
				string mamlText = MamlTextFileBuilder.MamlFile()
					.WithGuid("12345")
					.Build();

				using (var reader = new StringReader(mamlText))
				{
					Identifier id = TopicIdReader.LoadFrom(reader);

					Assert.Equal("12345", id.Value);
				}
			}
		}
	}
}
